﻿/*
 Copyright (c) 2011 Seth Juarez

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
*/

using System;
using ml.Attributes;

namespace ml.Tests.Model
{
    public enum Gender
    {
        Male,
        Female
    }

    public enum Cost
    {
        Cheap,
        Standard,
        Expensive
    }

    public enum IncomeLevel
    {
        Low,
        Medium,
        High
    }


    public enum TransMode
    {
        Bus,
        Train,
        Car
    }

    public class Travel
    {
        [Feature]
        public Gender Gender { get; set; }
        [Feature]
        public int Cars { get; set; }
        [Feature]
        public Cost Cost { get; set; }
        [Feature]
        public IncomeLevel IncomeLevel { get; set; }
        [Label]
        public TransMode TransportationMode { get; set; }

        /*
        Attributes				                                     Classes
        Gender	Car ownership	Travel Cost ($)/km	Income Level	Transportation mode
        Male	            0	      (0)Cheap	     (0)Low	            (0)Bus
        Male	            1	      (0)Cheap	     (1)Medium	        (0)Bus
        Female	            1	      (0)Cheap	     (1)Medium	        (1)Train
        Female	            0	      (0)Cheap	     (0)Low	            (0)Bus
        Male	            1	      (0)Cheap	     (1)Medium	        (0)Bus
        Male	            0	      (1)Standard	 (1)Medium	        (1)Train
        Female	            1	      (1)Standard	 (1)Medium	        (1)Train
        Female	            1	      (2)Expensive	 (2)High	        (2)Car
        Male	            2	      (2)Expensive	 (1)Medium	        (2)Car
        Female	            2	      (2)Expensive	 (2)High	        (2)Car
        */
        public static Travel[] GetData()
        {
            return new Travel[] {
                new Travel { Gender = Gender.Male, Cars = 0, Cost = Cost.Cheap, IncomeLevel = IncomeLevel.Low, TransportationMode = TransMode.Bus },
                new Travel { Gender = Gender.Male, Cars = 1, Cost = Cost.Cheap, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Bus },
                new Travel { Gender = Gender.Female, Cars = 1, Cost = Cost.Cheap, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Train },
                new Travel { Gender = Gender.Female, Cars = 0, Cost = Cost.Cheap, IncomeLevel = IncomeLevel.Low, TransportationMode = TransMode.Bus },
                new Travel { Gender = Gender.Male, Cars = 1, Cost = Cost.Cheap, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Bus },
                new Travel { Gender = Gender.Male, Cars = 0, Cost = Cost.Standard, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Train },
                new Travel { Gender = Gender.Female, Cars = 1, Cost = Cost.Standard, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Train },
                new Travel { Gender = Gender.Female, Cars = 1, Cost = Cost.Expensive, IncomeLevel = IncomeLevel.High, TransportationMode = TransMode.Car },
                new Travel { Gender = Gender.Male, Cars = 2, Cost = Cost.Expensive, IncomeLevel = IncomeLevel.Medium, TransportationMode = TransMode.Car },
                new Travel { Gender = Gender.Female, Cars = 2, Cost = Cost.Expensive, IncomeLevel = IncomeLevel.High, TransportationMode = TransMode.Car }
            };
        }
    }
}
